home *** CD-ROM | disk | FTP | other *** search
Wrap
AppleEvent Send and Receive A sample showing how to send and receive AppleEvents from Java using JDirect 2. For use with MRJ 2.1 and later. Version 1.0, 4/15/1999 by Levi Brown, and Michael Hopkins Apple Worldwide Developer Technical Support Apple Computer, Inc. Thanks to Steve Zellers, and Andy Bachorski. Copyright ©1999 Apple Computer, Inc. All rights reserved. Included in this archive: AESend and AEReceive, JBound applications. CodeWarrior and Visual Cafe projects for the AESend and AEReceive applications. All sources and resource files used to build the applications, including, an 'aete' resource to make the AEReceive application scriptable. Note: this does not include the JDirect wrapper sources. Receive Test Script, an AppleScript to send our event to the AEReceive application. Toolbox.jar, contains the classes for the JDirect wrapper functions for many commonly used Macintosh Toolbox functions. The sources for these classes are available as part of the MRJ 2.1 SDK installation (MRJ SDK 2.1:JDirect:JDirect 2.0 Sample Code:). The MRJ SDK is available for download at: http://developer.apple.com/java/text/download.html#sdk To run the samples: Run the AEReceive application by double-clicking on it. (Note that the AEReceive.jar and Toolbox.jar files need to be located in the same directory as the application.) The a message will come up announcing the installation of the AppleEvent handler. Run the AESend application by double-clicking on it. (Note that the AESend.jar and Toolbox.jar files need to be located in the same directory as the application.) Send the text displayed in the AESend application to the AEReceive application by clicking on the Send Event button, or hitting Enter while in the text field. You can also use the Receive Test Script AppleScript to send the AppleEvent to the AEReceive application. In either case, the AEReceive application will reply with a text message. For more information please refer to the sources, which are well commented. ______________________________________________________________________________ You may incorporate this sample code into your applications without restriction, though the sample code has been provided "AS IS" and the responsibility for its operation is 100% yours. However, what you are not permitted to do is to redistribute the source as "Apple Sample Code" after having made changes. If you're going to re-distribute the source, we require that you make it clear in the source that the code was descended from Apple Sample Code, but that you've made changes.